package com.base.cn.platform.os.service.exam.paper;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.exam.ExamBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 查询试卷关联的试题类型模板接口
 *
 * @author s.li
 * @date 2018/12/04
 */
@FeignClient(name = ExamBaseService.appName,configuration = FeignAuthConfig.class)
public interface ExamPaperQuestionTempService extends ExamBaseService {

    /**
     * 查询试卷关联的试题类型模板数据列表
     * @param condition 查询条件
     * @return List<ExamPaperQuestionTemp>
     */
    @RequestMapping(contextPath + "/findExamPaperQuestionTempList")
    List<Map<String,Object>> findExamPaperQuestionTempList(@RequestBody Map<String, Object> condition);

    /**
     * 保存试卷选择的试题类型模板
     * @param examId 试卷ID
     * @param templateIds 试题类型模板ID串
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/saveExamPaperQuestionTemp")
    Map<String, Object> saveExamPaperQuestionTemp(@RequestParam("examId") BigDecimal examId,
                                                  @RequestParam("templateIds") String templateIds);

    /**
     * 排序试卷试题类型模板
     * @param thisId 原记录ID
     * @param thisSort 新的排序号
     * @param targetId 目标记录ID
     * @param targetSort 新的排序号
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/updateOrderSort")
    Map<String,Object> updateOrderSort(@RequestParam("thisId") BigDecimal thisId,
                                       @RequestParam("thisSort") int thisSort,
                                       @RequestParam("targetId") BigDecimal targetId,
                                       @RequestParam("targetSort") int targetSort);
    /**
     * 获取试卷下的试题类型详情
     * @param condition 查询条件
     * @return ExamPaperQuestionTemp
     */
    @RequestMapping(contextPath + "/findExamPaperQuestionTempById")
    Map<String, Object> findExamPaperQuestionTempById(@RequestBody Map<String, Object> condition);

    /**
     * 删除试卷下的试题类型
     * @param templateIds 模板类型ID串
     * @param examId 试卷ID
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/deleteExamPaperTemp")
    Map<String,Object> deleteExamPaperTemp(@RequestParam("templateIds") String templateIds,
                                           @RequestParam("examId") BigDecimal examId);
}
